package com.cloud.wyf.Feign;


import com.cloud.wyf.Feign.FallBack.UserFeignFallBack;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestHeader;
import org.springframework.web.bind.annotation.RequestParam;

//TODO 写出feign的fallback逻辑
@FeignClient(value = "user-service",fallback = UserFeignFallBack.class)
public interface UserFeign {

    @GetMapping("/user")//得到相应的领导
    String queryLeaders(@RequestParam("uids") String uids);

    @GetMapping("/vote/needVote")//需要投票的中层干部
    String queryNeedVote(@RequestHeader("x-access-token") String token);

    @GetMapping("/vote/needLeaderShip")//需要投票的领导班子
    String queryNeedLeaderShip(@RequestHeader("x-access-token") String token);

    @GetMapping("/vote/isAuth")//判断是否可以投票
    String queryIsAuth(@RequestHeader("x-access-token") String token);

    @GetMapping("/total/getData")//获取中层干部人数和普通员工总人数
    String queryData(@RequestHeader("x-access-token") String token);

    @GetMapping("/total/getAllLeader")
    String queryAllLeader(@RequestHeader(value = "x-access-token") String token);//得到全部领导

    @GetMapping("/total/getAllMiddel")
    String queryAllMiddel(@RequestHeader(value = "x-access-token") String token);//得到全部中层干部

    @GetMapping("/total/getAllOrdinary")
    String queryAllOrdinary(@RequestHeader("x-access-token") String token);//得到全部职工

}
